home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / SETUP / US / CBUILDER / DATA.Z / OUTLINE.HPP < prev    next >
C/C++ Source or Header  |  1997-02-13  |  17KB  |  397 lines

  1. //----------------------------------------------------------------------------
  2. // Outline.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: Outline.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef OutlineHPP
  6. #define OutlineHPP
  7. //----------------------------------------------------------------------------
  8. #include <SysUtils.hpp>
  9. #include <Controls.hpp>
  10. #include <Grids.hpp>
  11. #include <StdCtrls.hpp>
  12. #include <Menus.hpp>
  13. #include <Graphics.hpp>
  14. #include <Classes.hpp>
  15. #include <Forms.hpp>
  16. #include <Messages.hpp>
  17. #include <Windows.hpp>
  18. #include <System.hpp>
  19. #pragma warn -par
  20. #pragma warn -hid 
  21. #pragma warn -inl
  22.  
  23. namespace Outline
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. class __declspec(delphiclass) OutlineError;
  27. class __declspec(pascalimplementation) OutlineError : public System::TObject
  28. {
  29.     typedef System::TObject inherited;
  30.     
  31. public:
  32.     /* TObject.Create */ __fastcall OutlineError(void) : System::TObject() { }
  33.     /* TObject.Destroy */ __fastcall virtual ~OutlineError(void) { }
  34.     
  35. };
  36.  
  37. class __declspec(delphiclass) EOutlineError;
  38. class __declspec(pascalimplementation) EOutlineError : public Sysutils::Exception
  39. {
  40.     typedef Sysutils::Exception inherited;
  41.     
  42. public:
  43.     /* Exception.Create */ __fastcall EOutlineError(const System::AnsiString Msg) : Sysutils::Exception(
  44.         Msg) { }
  45.     /* Exception.CreateFmt */ __fastcall EOutlineError(const System::AnsiString Msg, const System::TVarRec 
  46.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  47.     /* Exception.CreateRes */ __fastcall EOutlineError(int Ident) : Sysutils::Exception(Ident) { }
  48.     /* Exception.CreateResFmt */ __fastcall EOutlineError(int Ident, const System::TVarRec * Args, const 
  49.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  50.     /* Exception.CreateHelp */ __fastcall EOutlineError(const System::AnsiString Msg, int AHelpContext)
  51.          : Sysutils::Exception(Msg, AHelpContext) { }
  52.     /* Exception.CreateFmtHelp */ __fastcall EOutlineError(const System::AnsiString Msg, const System::TVarRec 
  53.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  54.         ) { }
  55.     /* Exception.CreateResHelp */ __fastcall EOutlineError(int Ident, int AHelpContext) : Sysutils::Exception(
  56.         Ident, AHelpContext) { }
  57.     /* Exception.CreateResFmtHelp */ __fastcall EOutlineError(int Ident, const System::TVarRec * Args, 
  58.         const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext)
  59.          { }
  60.     
  61. public:
  62.     /* TObject.Destroy */ __fastcall virtual ~EOutlineError(void) { }
  63.     
  64. };
  65.  
  66. enum TOutlineNodeCompare { ocLess, ocSame, ocGreater, ocInvalid };
  67.  
  68. enum TAttachMode { oaAdd, oaAddChild, oaInsert };
  69.  
  70. typedef Shortint TChangeRange;
  71.  
  72. class __declspec(delphiclass) TOutlineNode;
  73. class __declspec(delphiclass) TCustomOutline;
  74. enum TOutlineBitmap { obPlus, obMinus, obOpen, obClose, obLeaf };
  75.  
  76. typedef Set<TOutlineBitmap, obPlus, obLeaf>  TOutlineBitmaps;
  77.  
  78. typedef Graphics::TBitmap* TBitmapArray[5];
  79.  
  80. typedef void __fastcall (__closure *EOutlineChange)(System::TObject* Sender, long Index);
  81.  
  82. enum TOutlineStyle { osText, osPlusMinusText, osPictureText, osPlusMinusPictureText, osTreeText, osTreePictureText 
  83.     };
  84.  
  85. enum TOutlineType { otStandard, otOwnerDraw };
  86.  
  87. enum TOutlineOption { ooDrawTreeRoot, ooDrawFocusRect, ooStretchBitmaps };
  88.  
  89. typedef Set<TOutlineOption, ooDrawTreeRoot, ooStretchBitmaps>  TOutlineOptions;
  90.  
  91. class __declspec(pascalimplementation) TCustomOutline : public Grids::TCustomGrid
  92. {
  93.     typedef Grids::TCustomGrid inherited;
  94.     
  95. private:
  96.     bool FBlockInsert;
  97.     TOutlineNode* FRootNode;
  98.     TOutlineNode* FGoodNode;
  99.     int UpdateCount;
  100.     TOutlineNode* FCurItem;
  101.     System::AnsiString FSeparator;
  102.     int FFontSize;
  103.     Classes::TStrings* FStrings;
  104.     TOutlineBitmaps FUserBitmaps;
  105.     TOutlineBitmaps FOldBitmaps;
  106.     Graphics::TBitmap* FPictures[5];
  107.     EOutlineChange FOnExpand;
  108.     EOutlineChange FOnCollapse;
  109.     TOutlineStyle FOutlineStyle;
  110.     Graphics::TColor FMaskColor;
  111.     int FItemHeight;
  112.     TOutlineType FStyle;
  113.     TOutlineOptions FOptions;
  114.     bool FIgnoreScrollResize;
  115.     TOutlineNode* FSelectedItem;
  116.     Stdctrls::TDrawItemEvent FOnDrawItem;
  117.     bool FSettingWidth;
  118.     bool FSettingHeight;
  119.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  120.     long __fastcall GetItemCount(void);
  121.     long __fastcall AttachNode(long Index,  System::AnsiString Str, void * Ptr, TAttachMode AttachMode)
  122.         ;
  123.     TOutlineNode* __fastcall Get(long Index);
  124.     long __fastcall GetSelectedItem(void);
  125.     void __fastcall SetSelectedItem(long Value);
  126.     TOutlineNodeCompare __fastcall CompareNodes(TOutlineNode* Value1, TOutlineNode* Value2);
  127.     void __fastcall Error(int ErrorStringID);
  128.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  129.     bool __fastcall ResizeGrid(void);
  130.     void __fastcall DoExpand(TOutlineNode* Node);
  131.     void __fastcall Init(void);
  132.     void __fastcall MoveNode(long Destination, long Source, TAttachMode AttachMode);
  133.     void __fastcall ClearBitmap(Graphics::TBitmap* &Bitmap, TOutlineBitmap Kind);
  134.     void __fastcall ChangeBitmap(Graphics::TBitmap* Value, TOutlineBitmap Kind);
  135.     void __fastcall SetRowHeight(void);
  136.     void __fastcall SetCurItem(long Value);
  137.     void __fastcall CreateGlyph(void);
  138.     void __fastcall SetStrings(Classes::TStrings* Value);
  139.     Classes::TStrings* __fastcall GetStrings(void);
  140.     bool __fastcall IsCurItem(long Value);
  141.     void __fastcall SetPicture(int Index, Graphics::TBitmap* Value);
  142.     Graphics::TBitmap* __fastcall GetPicture(int Index);
  143.     void __fastcall DrawPictures(Graphics::TBitmap* const * BitMaps, const int BitMaps_Size, const Windows::TRect 
  144.         &ARect);
  145.     void __fastcall DrawText(TOutlineNode* Node, const Windows::TRect &Rect);
  146.     void __fastcall SetOutlineStyle(TOutlineStyle Value);
  147.     void __fastcall DrawTree(const Windows::TRect &ARect, TOutlineNode* Node);
  148.     void __fastcall SetMaskColor(Graphics::TColor Value);
  149.     void __fastcall SetItemHeight(int Value);
  150.     void __fastcall SetStyle(TOutlineType Value);
  151.     void __fastcall SetOutlineOptions(TOutlineOptions Value);
  152.     bool __fastcall StoreBitmap(int Index);
  153.     void __fastcall ReadBinaryData(Classes::TStream* Stream);
  154.     void __fastcall WriteBinaryData(Classes::TStream* Stream);
  155.     void __fastcall SetHorzScrollBar(void);
  156.     void __fastcall ResetSelectedItem(void);
  157.     void __fastcall SetRowFromNode(TOutlineNode* Node);
  158.     
  159. protected:
  160.     virtual void __fastcall Loaded(void);
  161.     virtual void __fastcall Click(void);
  162.     virtual void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  163.     virtual void __fastcall KeyPress(char &Key);
  164.     TOutlineNode* __fastcall SetGoodIndex(TOutlineNode* Value);
  165.     virtual void __fastcall DrawCell(long ACol, long ARow, const Windows::TRect &ARect, Grids::TGridDrawState 
  166.         AState);
  167.     virtual void __fastcall DblClick(void);
  168.     void __fastcall SetLevel(TOutlineNode* Node, Cardinal CurLevel, Cardinal NewLevel);
  169.     bool __fastcall BadIndex(TOutlineNode* Value);
  170.     void __fastcall DeleteNode(TOutlineNode* Node, long CurIndex);
  171.     virtual void __fastcall Expand(long Index);
  172.     virtual void __fastcall Collapse(long Index);
  173.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  174.     virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  175.         int Y);
  176.     void __fastcall Move(long Destination, long Source, TAttachMode AttachMode);
  177.     void __fastcall SetDisplayWidth(int Value);
  178.     __property Classes::TStrings* Lines = {read=GetStrings, write=SetStrings, nodefault};
  179.     __property TOutlineStyle OutlineStyle = {read=FOutlineStyle, write=SetOutlineStyle, default=5};
  180.     __property EOutlineChange OnExpand = {read=FOnExpand, write=FOnExpand};
  181.     __property EOutlineChange OnCollapse = {read=FOnCollapse, write=FOnCollapse};
  182.     __property TOutlineOptions Options = {read=FOptions, write=SetOutlineOptions, default=3};
  183.     __property TOutlineType Style = {read=FStyle, write=SetStyle, default=0};
  184.     __property int ItemHeight = {read=FItemHeight, write=SetItemHeight, nodefault};
  185.     __property Stdctrls::TDrawItemEvent OnDrawItem = {read=FOnDrawItem, write=FOnDrawItem};
  186.     __pr